package com.ymatou.shop.ui.view.item;

import java.util.Date;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.TextView;

import com.ymatou.shop.R;
import com.ymatou.shop.model.LeaveMessage;
import com.ymatou.shop.util.DateUtil;

public class LeaveMessageItemView extends FrameLayout {
	
	private TextView mNameTextView;
	private TextView mContentTextView;
	private TextView mDateTextView;
	
	public LeaveMessageItemView(Context context) {
		super(context);
		initLeaveMessageItemView();
	}
	
	private void initLeaveMessageItemView() {
		LayoutInflater.from(getContext()).inflate(R.layout.list_product_leave_message_item, this);
		
		mNameTextView = (TextView) findViewById(R.id.name_txt);
		mContentTextView = (TextView) findViewById(R.id.content_txt);
		mDateTextView = (TextView) findViewById(R.id.date_txt);
	}
	
	public void setData(LeaveMessage message) {
		mNameTextView.setText("@" + message.mBuyerName);
		mContentTextView.setText(message.mMessage);
		mDateTextView.setText(DateUtil.format(new Date(), "MM-dd HH:mm:ss"));/////////////
	}

}
